package com.woniuxy02;

/**
 * @author 作者
 * @create 2025-09-05 15:45
 * 汽车工厂，工厂生成汽车
 */
public class CarFactory {

    public static Car createCar(String type) {
        Car car = null;
        switch (type) {
            case "benz":
                car = new Benz();
                break;
            case "bmw":
                car = new Bmw();
                break;
        }
        return car;
    }
}
